1. Field of the Invention
The present invention relates to an imaging device that generates a photographic image data by photoelectrically converting an object image.
2. Description of the Related Art
In general, in an electronic camera, image data is subjected to compression coding processing in order to efficiently record a photographic image in a recording medium. A typical JPEG (Joint Photographic Experts Group) compression process is as follows. First, image data is divided into pixel blocks of about 8×8 pixels. Next, the image data is transformed into spatial frequency components by performing orthogonal transformation such as a DCT (discrete cosine transform) on the image block. Further, the DCT coefficient is subjected to quantization processing in accordance with each frequency component. Then, the quantized value is coding processed. Finally, the compression-coded image data is recorded in a recording medium etc.
Here, in compression-coded image data, in general, the code amount of an image of fine picture pattern is large, and conversely, the code amount of a smooth image is small. Therefore, the code amount differs in each compressed image, which causes a problem in managing recording capacity.
In view of this problem, in the above-mentioned quantization processing, a quantization table in which units of quantization are defined for the respective spatial frequency components is multiplied by a coefficient called a scale factor to create a quantization table optimized for each image. In general JPEG compression, the value of the scale factor is adjusted by repeating compression several times so that the final code amount falls within a desired range (refer to Japanese Patent No. 3427820). Note that in the same image data, the greater the scale factor, the larger the compression rate.
In the above-mentioned compression process, the compression-coded image data is recorded in a buffer memory temporarily. The smaller the recording region of the buffer memory assigned to processing of one frame is, the more the number of continuous frames at the time of continuous shooting increases.
However, in the compression coding processing of a conventional electronic camera, an initial scale factor is set in general using statistically average image data as a reference. When a shot image contains high-frequency components more than the above-mentioned reference image does, the code amount thereof after compression may exceed the target code amount.
Therefore, typically, the recording region of the buffer memory assigned to the processing of one frame is larger than the target code amount in order to prevent overflow. Because of this, the buffer memory is not used efficiently, which requires an improvement.